<div class="alert alert-success">Lưu ý: Vui lòng sử dụng tính năng <?=anchor(site_url('import'),'nhập bản quy đổi') ?> để có dữ liệu mới</div>
<form class="form-horizontal" role="form" method="post" action="<?=site_url('conversion/index') ?>">  
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Tìm theo mã (sản phẩm)</label>
    <div class="col-sm-3">
      <input type="text" name="search" class="form-control" id="inputPassword3" placeholder="Nhập mã hay sản phẩm cần tìm.." value="<?=isset($search) ? $search : "" ?>">     
    </div>        
  </div>     
  <button type="button" name="deleteAllBtn" value="delete-all" class="btn btn-danger" onclick="alert('Chức năng chỉ hoạt động với quản trị viên !')">Xóa dữ liệu</button>
</form>
<p></p>
<div class="table-responsive">
	<table class="table table-bordered" style="width: 70%">
		<thead>
			<tr align="center" class="success">
				<td>Sản phẩm</td>
				<td>Code</td>
				<td>Màu</td>
				<td>XS</td>
				<td>SL XS</td>
				<td>S</td>
				<td>SL S</td>
				<td>M</td>
				<td>SL M</td>
				<td>L</td>
				<td>SL L</td>
				<td>XL</td>
				<td>SL XL</td>
				<td>XXL</td>
				<td>SL XXL</td>
				<td>XXXL</td>
				<td>SL XXXL</td>
				<td>Total</td>
			</tr>
		</thead>
		<tbody>
			<?php	
				$i = 1;			
				foreach ($conversions as $conv):

				$total = $conv->xs_qty + $conv->s_qty + $conv->m_qty + $conv->l_qty + $conv->xl_qty + $conv->xxl_qty + $conv->xxxl_qty;
					
					echo "<tr align='center'>
						  <td>".$conv->product."</td>
						  <td>".$conv->code."</td>
						  <td>".$conv->color."</td>
						  <td>".$conv->xs_code."</td>
						  <td>".$conv->xs_qty."</td>
						  <td>".$conv->s_code."</td>
						  <td>".$conv->s_qty."</td>
						  <td>".$conv->m_code."</td>
						  <td>".$conv->m_qty."</td>
						  <td>".$conv->l_code."</td>
						  <td>".$conv->l_qty."</td>
						  <td>".$conv->xl_code."</td>
						  <td>".$conv->xl_qty."</td>
						  <td>".$conv->xxl_code."</td>
						  <td>".$conv->xxl_qty."</td>
						  <td>".$conv->xxxl_code."</td>
						  <td>".$conv->xxxl_qty."</td>
						  <td>".$total."</td>
						  </tr>
						  ";

					$i++;
				endforeach;
			?>
		</tbody>
	</table>
</div>